<?php
$url = lib_url::base();
$content = isset($var['content'])?$var['content']:'';
if (isset($var['simple']))
$v = <<<EOT
<script type="text/javascript" src="{$url}M/xheditor/xheditor-1.1.14-zh-cn.min.js"></script>
<script type="text/javascript">
$(function(){
	editor = $('textarea[name="content"]').xheditor({
		width:550,height:250
	});
});
</script>
<textarea name="content"></textarea>
EOT;
else $v = <<<EOT
<script type="text/javascript" src="{$url}M/xheditor/xheditor-1.1.14-zh-cn.min.js"></script>
<script type="text/javascript">
$(function(){
	editor = $('textarea[name="content"]').xheditor({
		width:670,height:400,
		localUrlTest:/^https?:\/\/[^\/]*?(php302\.com)\//i,
		remoteImgSaveUrl:'{$url}M/xheditor/saveremoteimg.php'
	});
});
</script>
<textarea name="content">{$content}</textarea>
EOT;
return $v;